package com.xiaoshuidi.cloud.module.finance.enums.withdraw;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum WithdrawStatusEnum {

    PROCESS("进行中"),
    SUCCESS("提现成功"),
    FAILURE("失败");

    private final String name;

    public static boolean isSuccess(String status) {
        return Objects.equals(status, SUCCESS.name());
    }

    public static boolean isSuccess(WithdrawStatusEnum status) {
        return SUCCESS == status;
    }

    public static String getDesc(String name) {
        for (WithdrawStatusEnum value : values()) {
            if (value.name().equals(name)) {
                return value.getName();
            }
        }
        return "";
    }
}
